import { useStore } from '@/store/index';

export default defineNuxtRouteMiddleware((to, from) => {
  const store = useStore();
  
  // 确保该代码仅在客户端执行
  if (process.client) {
    const screenWidth = window.innerWidth;

    // 检查屏幕宽度是否大于1200像素，如果是，则设置为PC端
    if (screenWidth > 1200) {
      store.setIsPc(1);
    }else{
        store.setIsPc(2);
    }
  }
  console.log(store.isPc,'cxzczsczwadawdwa')
});